# Contributor: Anjandev Momi <anjan@momi.ca>
# Maintainer: Anjandev Momi <anjan@momi.ca>
pkgname=uranium
pkgver=4.13.1
pkgrel=0
pkgdesc="A Python framework for building Desktop applications"
url="https://github.com/Ultimaker/Uranium"
arch="noarch !armhf !riscv64" # armhf: no py3-qt5, rv64: no py3-shapely
license="LGPL-3.0-or-later"
depends="
	python3
	py3-qt5
	py3-numpy
	py3-libarcus
	py3-shapely
	py3-scipy
	py3-cryptography
	py3-twisted
	 "
# add cura-binary-data to makedepends when packaged
makedepends="samurai cmake doxygen gettext gettext-dev graphviz"
checkdepends="py3-pytest py3-pytest-benchmark"
source="$pkgname-$pkgver.tar.gz::https://github.com/Ultimaker/Uranium/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/Uranium-$pkgver"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=minsizerel \
		-DGETTEXT_MSGINIT_EXECUTABLE=msginit \
		-DCURA_BINARY_DATA_DIRECTORY=/usr/share/cura \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

check() {
	# useless code style test with another dependency
	ctest -j $JOBS --output-on-failure -T Test
}

package() {
	DESTDIR="$pkgdir" cmake --install build
	mkdir "$pkgdir"/usr/share/uranium/cmake
	mv "$pkgdir"/usr/share/cmake-*/Modules/* "$pkgdir"/usr/share/uranium/cmake/
}

sha512sums="
ff9573104c9cdf0a1ba3ff304c17dbbcdab561a7158138067067ea3c2d063c139545effb1b1c944da986053cb3ea68dc5b947c30c5578ef29f6858e3f9e461c3  uranium-4.13.1.tar.gz
"
